package cn.ultrarisk.scadmin.manager.biz.solr.dto;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * CollectionDeleter
 *
 * @author sevendlong(lin23871@163.com)
 * @date 2014/6/8
 * @since V1.0
 */
public class CollectionDeleter implements Serializable {
    private static final long serialVersionUID = -892124318335198539L;

    private String query;
    private Boolean commit;

    public Boolean getCommit() {
        return commit;
    }

    public void setCommit(Boolean commit) {
        this.commit = commit;
    }

    public String getQuery() {
        return query;
    }

    public void setQuery(String query) {
        this.query = query;
    }

    public Map<String, Object> getParams() {
        Map<String, Object> querys = new LinkedHashMap<String, Object>();

        querys.put("commit", commit);
        querys.put("wt", "json");
        querys.put("indent", true);

        return querys;
    }

    public String getPostData() {
        return "<delete><query>" + query + "</query></delete>";
    }

    public String getContentType() {
        return "text/xml";
    }
}
